package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class EmbeddedVariableSpecification implements GeneralValueSpecification, TargetSpecification {

    private int beginIndex;
    private int endIndex;
    private EmbeddedVariableName embeddedVariableName;
    private IndicatorVariable indicatorVariable;

    public EmbeddedVariableSpecification(EmbeddedVariableName embeddedVariableName,
                                         IndicatorVariable indicatorVariable) {
        this.beginIndex = embeddedVariableName.getBeginIndex();
        this.endIndex = indicatorVariable != null ? indicatorVariable.getEndIndex() : embeddedVariableName.getEndIndex();
        this.embeddedVariableName = embeddedVariableName;
        this.indicatorVariable = indicatorVariable;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public EmbeddedVariableName getEmbeddedVariableName() {
        return embeddedVariableName;
    }

    public IndicatorVariable getIndicatorVariable() {
        return indicatorVariable;
    }

}
